home *** CD-ROM | disk | FTP | other *** search
-
- /*© Copyright 1988-1993 UserLand Software, Inc. All Rights Reserved.*/
-
- #include "iacinternal.h"
-
-
-
- Boolean IACpushbinaryparam (Handle val, OSType binarytype, OSType keyword) {
-
- return (IACpushbinaryitem (IACglobals.event, val, binarytype, keyword));
- } /*IACpushbinaryparam*/
-
-
- Boolean IACreturnbinary (Handle x, OSType binarytype) {
-
- return (IACpushbinaryitem (IACglobals.reply, x, binarytype, keyDirectObject));
- } /*IACreturnbinary*/
-
-
- Boolean IACgetbinaryparam (OSType keyword, Handle *hbinary, OSType *binarytype) {
-
- if (!IACgetbinaryitem (IACglobals.event, keyword, hbinary, binarytype)) {
-
- IACparamerror (IACglobals.errorcode, "\pbinary", keyword);
-
- return (false);
- }
-
- IACglobals.nextparamoptional = false; /*must be reset for each param*/
-
- return (true);
- } /*IACgetbinaryparam*/
-
-
- Boolean IACgetbinaryitem (AEDescList *list, long n, Handle *val, OSType *binarytype) {
-
- register OSErr ec;
- AEDesc desc;
- DescType key;
- Size actualSize;
-
- if ((*list).descriptorType != typeAEList) {
-
- ec = AEGetKeyDesc (list, n, typeWildCard, &desc);
-
- if (ec != errAEDescNotFound)
- goto done;
- }
-
- ec = AEGetNthDesc (list, n, typeWildCard, &key, &desc);
-
- done:
-
- IACglobals.errorcode = ec;
-
- if (ec == noErr) {
-
- *binarytype = desc.descriptorType;
-
- *val = desc.dataHandle;
-
- return (true);
- }
- else {
- *binarytype = 0L;
-
- *val = NULL;
-
- return (false);
- }
- } /*IACgetbinaryitem*/
-
-
- Boolean IACpushbinaryitem (AEDescList *list, Handle val, OSType binarytype, long n) {
-
- register OSErr ec;
- AEDesc desc;
-
- desc.descriptorType = binarytype;
-
- desc.dataHandle = val;
-
- if ((*list).descriptorType != typeAEList)
-
- ec = AEPutKeyDesc (list, n, &desc);
- else
- ec = AEPutDesc (list, n, &desc);
-
- IACglobals.errorcode = ec;
-
- AEDisposeDesc (&desc);
-
- return (ec == noErr);
- } /*IACpushbinaryitem*/
-
-
-